home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
001
/
pibt40s6.arc
/
UPDATERE.MOD
< prev
next >
Wrap
Text File
|
1987-09-08
|
1KB
|
49 lines
(*----------------------------------------------------------------------*)
(* Update_Review_Pointers --- Update review buffer pointers *)
(*----------------------------------------------------------------------*)
PROCEDURE Update_Review_Pointers;
VAR
L: INTEGER;
I: INTEGER;
BEGIN (* Update_Review_Pointers *)
(* Append CR/LF as needed *)
L := MIN( ORD( Review_Line[0] ) , Max_Review_Line_Length );
Review_Line[L+1] := CHR( CR );
Review_Line[L+2] := CHR( LF );
L := L + 2;
Review_Line[0] := CHR( L );
FOR I := 1 TO L DO
BEGIN
(* Increment capture pointer *)
Review_Head := SUCC( Review_Head );
IF Review_Head > Max_Review_Length THEN
Review_Head := 1;
(* If we wrapped into last char, *)
(* update last char pointer *)
IF Review_Head = Review_Tail THEN
BEGIN
Review_Tail := SUCC( Review_Tail );
IF Review_Tail > Max_Review_Length THEN
Review_Tail := 1;
END;
IF Review_Tail = 0 THEN
Review_Tail := 1;
Review_Buffer^[Review_Head] := Review_Line[I];
END;
Review_Line[0] := #0;
END (* Update_Review_Pointers *);